<template>
  <div class="xy-grid">
    <van-grid :column-num="datas.gridProps.columnNum" :gutter="datas.gridProps.gutter" :border="datas.gridProps.border">
      <!--      {text: '商城', icon: '', url: '',iconColor: '', linkType: '', useSlot: false, slotImageSrc: 'https://img.yzcdn.cn/vant/apple-1.jpg' }-->
      <van-grid-item
          :key="index"
          :icon="item.icon"
          :icon-color="item.iconColor"
          :text="item.text"
          :linkType="item.linkType"
          :useSlot="item.useSlot"
          v-for="(item, index) in datas.gridItemProps">
        <template #icon>
          <div :style="'font-size: ' + datas.gridProps.iconSize + 'px;' + (item.iconColor.length > 0?'color:' + item.iconColor : '') ">
            <i :class="item.icon"></i>
            <van-icon :name="item.icon"></van-icon>
          </div>
        </template>
      </van-grid-item>
    </van-grid>


    <!-- 删除组件 -->
    <slot name="deles"/>
  </div>
</template>

<script>
export default {
  name: 'xyGrid',
  props: {
    datas: Object,
  },

  created() {
  },

  methods: {},
}
</script>

<style scoped lang="less">
.xy-grid {
  position: relative;
}

</style>